package com.tjetc.dao;

import com.tjetc.entity.Dish;
import com.tjetc.entity.DishRequest;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/*
菜品分类
*/
public interface DishMapper {
    //添加新的菜品
    int insert(Dish dish);

    //根据id删除菜品
    int deleteById(Integer id);

    //根据id查找菜品
    Dish selectById(Integer id);
    // 查询所有菜品

    List<Dish> selectByLikeUser(@Param("dishName") String dishName,
                                @Param("merchantName") String merchantName,
                                @Param("upPrice") Integer upPrice,
                                @Param("downPrice") Integer downPrice);

    Integer deleteDishes(List<Integer> ids);

    List<Dish> selectByCategoryId(int id, int merchantId);

    List<Dish> selectAll();

    List<Dish> selectByDishname(String name);

    List<Dish> selectByMerchantId(int id);

    List<Dish> selectByCateId(int id);

    Dish selectByName(String name);

    Integer update(Dish dish);

    List<Dish> selectByList(List<Integer> list);

    List<Dish> selectDetailByMerchantId(int id);


    List<Dish> selectHot(int merchantId);

    Dish selectDetailByDishId(int id);

    int updateDishDetail(Dish dish);

    Long countDishWaiting();

    int changeStatusById(Integer id, Integer status);

    List<Dish> selectExamine(Integer id);

    Integer passDishes(List<Integer> ids);

    //减少菜品库存
    Integer deleteDishInventory(Integer num, Integer id);

    //根据店家id查菜系二级分类
    List<Integer> selectCategoryById(int merchantId);

    Integer countDishByMerchantId(int id);

    Integer countDishWith(HashMap map);

    List<Dish> selectDishWith(HashMap map);
}
